package com.fr.report.painter.shape;

import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import java.awt.Shape;
import java.awt.geom.Line2D.Double;

public class LineShapePainter extends AbstractShapePainter
{
  private boolean isPositiveArrow = false;

  public Shape getShape(double paramDouble1, double paramDouble2)
  {
    if (isPositiveArrow())
      return new Line2D.Double(0.0D, paramDouble2, paramDouble1, 0.0D);
    return new Line2D.Double(0.0D, 0.0D, paramDouble1, paramDouble2);
  }

  public boolean isPositiveArrow()
  {
    return this.isPositiveArrow;
  }

  public void setPositiveArrow(boolean paramBoolean)
  {
    this.isPositiveArrow = paramBoolean;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if ((paramXMLableReader.isChildNode()) && (paramXMLableReader.getTagName().equals("Attributes")))
    {
      String str = null;
      if ((str = paramXMLableReader.getAttr("isPositiveArrow")) != null)
        setPositiveArrow(Boolean.valueOf(str).booleanValue());
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    super.writeXML(paramXMLPrintWriter);
    paramXMLPrintWriter.startTAG("Attributes").attr("isPositiveArrow", isPositiveArrow()).end();
  }
}